#@layout()
#define main()
<div class="layui-col-md12">
    <div class="layui-card">
        <div class="layui-card-body">
            <div class="layui-form-query">
                <form class="layui-form" id="query_form">
                    <div class="layui-form-item">
                        <div class="layui-inline">
                            <label class="layui-form-mid">名称：</label>
                            <div class="layui-input-inline" style="width: 100px;">
                                <input type="text" name="name" autocomplete="off" class="layui-input"/>
                            </div>
                        </div>
                        <div class="layui-inline">
                            <div class="layui-input-inline">
                                <button class="layui-btn layui-btn-blue" type="button" function="query"><i class="layui-icon">&#xe615;</i>查询</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
            <table id="fsDatagrid" lay-filter="fsDatagrid" class="fsDatagrid" toolbar="#toolbarDemo" title="科目列表" defaultToolbar="filter" isTotalRow="1" isLoad="1" url="#(base)/subject/getSubjectPage"
                   isPage="1" sortType="1" pageSize="10" defaultForm="query_form"></table>

            <div class="fsDatagridCols">
                <p type="numbers" title="序号"/>
                <p type="checkbox" title="选择"/>
                <p field="id" title="ID" />
                <p field="name" title="名称" />
                <p field="createtime" title="创建时间"/>
                <p field="username" title="创建人"/>
                <p fixed="right" align="center" toolbar="#barDemo" title="操作"/>
            </div>

            <script type="text/html" id="toolbarDemo">
                <div class="layui-btn-container">
                    #if(roletool.isPower(session.usersession.role_id, 9))
                    <button class="layui-btn layui-btn-sm layui-btn-blue" function="top" topUrl="#(base)/subject/showSubject" topWidth="800px" isMaximize="0" topHeight="600px" topTitle="新增科目">
                        <i class="layui-icon">&#xe654;</i>新增
                    </button>
                    #end
                    #if(roletool.isPower(session.usersession.role_id, 10))
                    <button class="layui-btn layui-btn-sm layui-btn-danger" function="submit" method="get" url="#(base)/subject/deleteSubject" isMutiDml="1" isConfirm="1" confirmMsg="是否确定删除选中的数据？" inputs="id:">
                        <i class="layui-icon">&#xe640;</i>批量删除
                    </button>
                    #end
                    <button class="layui-btn layui-btn-sm layui-btn-blue" function="refresh">
                        <i class="layui-icon">&#xe666;</i>刷新
                    </button>
                </div>
            </script>
            <script type="text/html" id="barDemo">
                #if(roletool.isPower(session.usersession.role_id, 11))
                <a class="layui-btn layui-btn-xs layui-btn-blue" lay-event="top" topUrl="#(base)/subject/showSubject" topWidth="800px" topHeight="600px" topTitle="编辑科目" inputs="id:">编辑</a>
                #end
                #if(roletool.isPower(session.usersession.role_id, 10))
                <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="submit" url="#(base)/subject/deleteSubject" isConfirm="1" method="get" confirmMsg="是否确定删除当前记录？" inputs="id:">删除</a>
                #end
            </script>
        </div>
    </div>
</div>
#end